package com.feng.cloud.job.executor.feign;

import com.feng.cloud.job.executor.feign.fallback.AuthServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.Map;

/**
 * @ClassName AuthService
 * @Description TODO
 * @Author Better Feng
 * @Date 2020/1/16 18:10
 * @Version 1.0
 **/
@FeignClient(value = "feng-auth",contextId = "authServiceClient",fallbackFactory = AuthServiceFallback.class)
public interface AuthService {

    @PostMapping("/oauth/token")
    ResponseEntity<OAuth2AccessToken> postAccessToken(@RequestHeader("Authorization") String authorization, Map<String, String> parameters);
}
